package com.tanchengjin.admin.modules.blog.utils.pagination;

import java.util.List;

public class Pagination<T> {
    private int firstPage;
    private int lastPage;
    private int currentPage;
    private List<T> rows;
    private int page;
    private int size;
    private long totalSize;

    public int getFirstPage() {
        return firstPage;
    }

    public void setFirstPage(int firstPage) {
        this.firstPage = firstPage;
    }

    public int getLastPage() {
        return lastPage;
    }

    public void setLastPage(int lastPage) {
        this.lastPage = lastPage;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        if (page <= 0) page = 1;
        this.page = page;
    }

    public int getSize() {
        if (size <= 0) size = 9;
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public long getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(long totalSize) {
        this.totalSize = totalSize;
    }
}
